package com.clouds.wms.service;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.clouds.wms.bean.Salmb;
import com.clouds.wms.bean.Salmd;
import com.clouds.wms.dao.SalmcDao;
import com.clouds.wms.dao.SalmdDao;
import com.clouds.wms.exception.SysException;
import com.clouds.wms.util.PagesBean;

@Service("salmdService")
public class SalmdServiceImpl implements SalmdService {
	@Resource(name="salmcDao")
	private SalmcDao salmcDao;
	@Resource(name="salmdDao")
	private SalmdDao salmdDao;

	@Override
	public PagesBean getSalmdList(String mcaa, String mcab, int offset,int pageSize) throws SysException {
		return salmdDao.getSalmdList(mcaa, mcab, offset, pageSize);
	}

	@Override
	public int saveSalmd(Salmd salmd) throws SysException {
		return salmdDao.saveSalmd(salmd);
	}

	@Override
	public int getMaxMdac() throws SysException {
		return salmdDao.getMaxMdac();
	}

	@Override
	public int delSalmd(String mdaa, String mdab, String mdacs)	throws SysException {
		return salmdDao.delSalmd(mdaa, mdab, mdacs);
	}

	@Override
	public int updateSalmd(Salmd salmd) throws SysException {
		return salmdDao.updateSalmd(salmd);
	}

	@Override
	public int changeStatus(String mdaa, String mdab, String status)throws SysException {
		return salmdDao.changeStatus(mdaa, mdab, status);
	}

	@Override
	public void delSalmcmd(String mcaa, String mcab) throws SysException {
		salmcDao.delSalmcByAaAb(mcaa, mcab);
		salmdDao.delSalmdByAaAb(mcaa, mcab);
	}

	@Override
	public void delSalmdAll(String mcaa, String mcab) throws SysException {
		salmdDao.delSalmdByAaAb(mcaa, mcab);
	}
}
